import request from '@/utils/request'
import { getToken } from '@/utils/auth'

// 品牌查询
export function listBrand(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/brand/list',
    method: 'get',
    params: query
  })
}

// 保存
export function saveBrand(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/brand/save',
    method: 'post',
    data
  })
}

// 删除
export function deleteBrand(id) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/brand/delete/' + id,
    method: 'get'
  })
}

// 检查品牌名称
export function checkBrandName(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/brand/checkBrandName',
    method: 'get',
    params: query
  })
}
